import json

from flask import Flask

from config.config import Config

app = Flask(__name__)
app.config.from_object(Config)


@app.template_filter('json_loads')
def json_loads_filter(s):
    try:
        return json.loads(s)
    except json.decoder.JSONDecodeError:
        return []


# 注册蓝图
from web.routes import web_bp

app.register_blueprint(web_bp)

if __name__ == '__main__':
    app.run(debug=True)
